package com.example.hello;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class StringWrap {

    private String string;

    public StringWrap() {
        this("");
    }

    public StringWrap(String string) {
        this.string = string;
    }

    public void setString(String string) {
        this.string = string;
    }

    public String getEncoded() {
        try {
            return URLEncoder.encode(string, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            return string;
        }
    }

    public String toString() {
        return string;
    }

}
